package com.xiangxiao.rpan.storage.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

/**
 * @Projectname: StorageParamTypeEnum
 * @Author: xiangxiao
 * @Email: 573768011@qq.com
 * @Data:2023/10/21 0:48
 */
@Getter
public enum StorageParamTypeEnum {
  /**
   * 输入框
   */
  INPUT("input"),

  /**
   * 下拉框
   */
  SELECT("select"),

  /**
   * 开关
   */
  SWITCH("switch");


  private String value;

  @JsonValue
  public String getStorageParamTypeEnum() {
    return this.value.toUpperCase();
  }

  @JsonCreator
  public static StorageParamTypeEnum fromString(String type) {
    return type == null
        ? null
        : StorageParamTypeEnum.valueOf(type.toUpperCase());
  }

  StorageParamTypeEnum(String val) {
    this.value = val.toUpperCase();
  }
}
